package com.dubbo.sl;

import com.dubbo.sunne.service.UserService;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/sunne")
public class UserController implements ApplicationContextAware {
    ApplicationContext application;

    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
        this.application = applicationContext;
    }
    @Autowired
    UserService userService;
    @RequestMapping("/queryUser")
    @ResponseBody
    public String queryUser(){
        String str = userService.getUser("12");
        return str;
    }

}
